<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?php echo $pageNum ?>" />
	<input type="hidden" name="numPerPage" value="<?php echo $limit ?>" />
	<input type="hidden" name="orderField" value="<?php echo $field ?>" />
	<input type="hidden" name="orderDirection" value="<?php echo $order_by ?>" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return dwzSearch(this, 'dialog');" action="<?php echo site_url('backend/warehouse/addProduct'); ?>" method="post">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>商品名称：</label>
					<input type="text" name="name" value="<?php echo $this->input->post('name') ?>"/>
				</li>
				<li>
					<select name="category_id" class="combox">
						<option value="">所有分类</option>
						<?php echo $this->html_helper->select($categoryList, $this->input->post('category_id'))?>
					</select>
				</li>
				<li>
					<select class="combox" name="status">
						<option value="">所有状态</option>
						<?php echo $this->html_helper->select(array('10'=>'启用', '0'=>'禁用'),$this->input->post('status'));?>
					</select>
				</li>
			</ul>
			<div class="subBar right">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">

	<table class="table" width="100%" targetType="dialog" layoutH="112">
		<thead>
			<tr>
				<th orderField="id" class="<?php echo $order_by ?>">ID</th>
				<th>商品名称</th>
				<th>展示图片</th>
				<th>商品规格</th>
				<th>商品单价/元</th>
				<th>商品状态</th>
				<th>库存</th>
				<th>热销</th>
				<th>限购/数量</th>
				<th width="80">查找带回</th>
			</tr>
		</thead>
		<tbody class="gridImg">
			<?php foreach ($data as $al): ?>
				<tr>
					<td><?php echo $al['id'] ?></td>
					<td><?php echo $al['name'] ?></td>
					<td><a href="<?php echo base_url($al['thumbnail']) ?>" data-target="fancybox" data-fancybox-group="gallery" title="<?php echo $al['name'] ?>"><img src="<?php echo base_url($al['thumbnail']) ?>" height="48"></a></td>
					<td><?php echo $al['specs'] ?></td>
					<td><?php echo $al['price'] / 100.00 ?></td>
					<td><?php if ($al['status'] == 10): ?>启用<?php else: ?>禁用<?php endif; ?></td>
					<td><?php echo $al['stock'] ?></td>
					<td><?php echo ($al['isHot'] == 10)?'是':'否' ?></td>
					<td><?php echo ($al['isLimit'] == 10)?"是 ({$al['limit_num']})":'否' ?></td>
					<td>
						<a class="btnSelect" href="javascript:$.bringBack({'orgName]':'<?php echo $al['name']?>', 'orgNum]':'<?php echo $al['id']?>', 'stock]':'<?php echo $al['stock']?>'})" title="查找带回">选择</a>
					</td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
	
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="dwzPageBreak({targetType:'dialog', numPerPage:this.value})">
				<?php echo $this->html_helper->select(array('20'=>'20'), $limit)?>
			</select>
			<span>条，共<?php echo $totalCount?>条</span>
		</div>

		<div class="pagination" targetType="dialog" totalCount="<?php echo $totalCount?>" numPerPage="<?php echo $limit?>" pageNumShown="10" currentPage="<?php echo $pageNum?>"></div>

	</div>
</div>